import request from "network/request"


/**
 * 返回搜索建议数据
 * @param {String} keyWord
 * @return {Promise} 返回搜索建议数据
 * @author yigencong <yigencong@yahoo.com>
 */
export function searchSuggest(keyWord) {
    return request({
        method: 'get',
        url: '/search/suggest',
        params: {
            keywords: keyWord
        }
    })
}


export function recommendMusic() {
    return request({
        method: 'post',
        url: '/search/hot/detail',
        // data:{
        //     "cookie":"__csrf=925b5319039912dbfc4bd979d9b12824; Max-Age=1296010; Expires=Fri, 18 Dec 2020 06:52:59 GMT; Path=/;;MUSIC_U=a70c976cd23ef5e33c358479ebd8590eb0b091fabdc32882a41de1e537bed77f33a649814e309366; Max-Age=1296000; Expires=Fri, 18 Dec 2020 06:52:49 GMT; Path=/;;__remember_me=true; Max-Age=1296000; Expires=Fri, 18 Dec 2020 06:52:49 GMT; Path=/;"
        // }
    })
}

/**
 * 获取搜索界面的数据
 * type: 搜索类型；默认为 1 即单曲 , 取值意义 : 1: 单曲, 10: 专辑, 100: 歌手, 1000: 歌单, 1002: 用户, 1004: MV, 1006: 歌词, 1009: 电台, 1014: 视频, 1018:综合
 */
export function searchKeyWords(keywords, offset, type) {
    return request({
        method: "get",
        url: "/search",
        params: {
            keywords: keywords,
            offset: offset,
            type: type
        }
    })
}

